package asava.trees;

import asava.names.Name;

import java.util.List;

/**
 * @author Tim Richter
 */
public final class Function extends Tree {
    public int modifiers;
    public Name name;
    public List<Tree> params;
    public Tree result;
    public Tree body;

    public Function(final int modifiers,
                    final Name name,
                    final List<Tree> params,
                    final Tree result,
                    final Tree body) {
        this.modifiers = modifiers;
        this.name = name;
        this.params = params;
        this.result = result;
        this.body = body;
    }

    @Override
    public int kind() {
        return TreeKind.FUNCTION;
    }

    @Override
    public void accept(final TreeVisitor visitor) {
        visitor.visit(this);
    }
}
